home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / ivd2dvi / global.h < prev    next >
C/C++ Source or Header  |  1990-10-01  |  2KB  |  66 lines

  1. /*
  2.  *  Global definitions for ivd2dvi.  Copyright 1988 by Larry Denenberg.
  3.  *  May be freely distributed as long as this notice is retained.
  4.  */
  5.  
  6. #define TRUE          1
  7. #define FALSE          0
  8.  
  9.  
  10. /*
  11.  *  Buffer sizing and allocation is explained in io.c.
  12.  */
  13. #define BUFDEFAULTSIZE 1024
  14. #define SMALLBUFDIVISOR     16
  15. #define MAXFILENAMESIZE 256
  16. #define TFMAREADEFAULT    "/usr/local/lib/tex/fonts"
  17.  
  18.  
  19. /*
  20.  *  Values of /State/;  see the overview in ivd2dvi.c.
  21.  */
  22. #define LTYPESETTING      0
  23. #define RTYPESETTING      1
  24. #define SIMULATING      2
  25.  
  26.  
  27. /*
  28.  *  Allocate an object of type T or a sequence of N such objects.
  29.  */
  30. #define OBJALLOC(T)    ((T *) malloc(sizeof(T)))
  31. #define SEQALLOC(N,T)    ((T *) calloc((unsigned) N, sizeof(T)))
  32.  
  33.  
  34. /*
  35.  *  Library routines declared to avoid lint errors.
  36.  */
  37. extern char *calloc(), *malloc(), *rindex(), *index(), *getenv();
  38. extern void exit();
  39.  
  40.  
  41. /*
  42.  *  Useful types.  If your compiler doesn't recognize unsigned char,
  43.  *  you'll have to find another one-byte unsigned integer.
  44.  */
  45. typedef unsigned char unsigned_byte;
  46. typedef short boolean;
  47.  
  48.  
  49. /*
  50.  *  Structure for font information.  Note that /charwidths/ is a table
  51.  *  of length ec-bc+1 giving the width of each character;  each entry
  52.  *  in this table is an index into the /widths/ table where the widths
  53.  *  really reside.  Further information is in the file auxiliary.c.
  54.  */
  55. typedef struct font {
  56.   long number;            /*  font number in the DVI file        */
  57.   char *area, *name;        /*  strings naming the associated file     */
  58.   long checksum, scalefactor;   /*  you figure this one out        */
  59.   boolean loaded;        /*  TRUE iff we've read the TFM file    */
  60.   int nw;            /*  number of distinct widths        */
  61.   long *widths;            /*  the distinct widths         */
  62.   int bc, ec;            /*  beginning and ending char numbers    */
  63.   unsigned_byte *charwidths;    /*  widths of the individual characters    */
  64.   struct font *nextfont;    /*  pointer to the next font        */
  65. } font;
  66.